<?php

namespace KGK\StoreBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * KGK\StoreBundle\Entity\Produit
 *
 * @ORM\Table(name="produit")
 * @ORM\Entity
 */
class Produit
{	
    /**
     * @var integer $prodId
     *
     * @ORM\Column(name="PROD_ID", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $prodId;

    /**
     * @var text $prodLibelle
     *
     * @ORM\Column(name="PROD_LIBELLE", type="text", nullable=true)
     */
    private $prodLibelle;

    /**
     * @var text $prodDescription
     *
     * @ORM\Column(name="PROD_DESCRIPTION", type="text", nullable=true)
     */
    private $prodDescription;

    /**
     * @var float $prodPrix
     *
     * @ORM\Column(name="PROD_PRIX", type="float", nullable=true)
     */
    private $prodPrix;

    /**
     * @var float $prodPoids
     *
     * @ORM\Column(name="PROD_POIDS", type="float", nullable=true)
     */
    private $prodPoids;

    /**
     * @var integer $prodStock
     *
     * @ORM\Column(name="PROD_STOCK", type="integer", nullable=true)
     */
    private $prodStock;

    /**
     * @var text $prodLienImage
     *
     * @ORM\Column(name="PROD_LIEN_IMAGE", type="text", nullable=true)
     */
    private $prodLienImage;

    /**
     * @var text $prodLienProd
     *
     * @ORM\Column(name="PROD_LIEN_PROD", type="text", nullable=true)
     */
    private $prodLienProd;

    /**
     * @var Commande
     *
     * @ORM\ManyToMany(targetEntity="Commande", mappedBy="prod")
     */
    private $comm;

    /**
     * @var Categorie
     *
     * @ORM\ManyToOne(targetEntity="Categorie")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="CAT_ID", referencedColumnName="CAT_ID")
     * })
     */
    private $cat;

    public function __construct()
    {
        $this->comm = new \Doctrine\Common\Collections\ArrayCollection();
    }
    

    /**
     * Get prodId
     *
     * @return integer 
     */
    public function getProdId()
    {
        return $this->prodId;
    }

    /**
     * Set prodLibelle
     *
     * @param text $prodLibelle
     */
    public function setProdLibelle($prodLibelle)
    {
        $this->prodLibelle = $prodLibelle;
    }

    /**
     * Get prodLibelle
     *
     * @return text 
     */
    public function getProdLibelle()
    {
        return $this->prodLibelle;
    }

    /**
     * Set prodDescription
     *
     * @param text $prodDescription
     */
    public function setProdDescription($prodDescription)
    {
        $this->prodDescription = $prodDescription;
    }

    /**
     * Get prodDescription
     *
     * @return text 
     */
    public function getProdDescription()
    {
        return $this->prodDescription;
    }

	/**
     * Get prodProdDescriptionTronquee
     *
     * @return text 
     */
	public function getProdDescriptionTronquee()
	{
		if (strlen($this->prodDescription) > 170)
			return (substr($this->prodDescription, 0, 167)."...");
		else
			return $this->prodDescription;
	}
	
    /**
     * Set prodPrix
     *
     * @param float $prodPrix
     */
    public function setProdPrix($prodPrix)
    {
        $this->prodPrix = $prodPrix;
    }

    /**
     * Get prodPrix
     *
     * @return float 
     */
    public function getProdPrix()
    {
        return $this->prodPrix;
    }

    /**
     * Set prodPoids
     *
     * @param float $prodPoids
     */
    public function setProdPoids($prodPoids)
    {
        $this->prodPoids = $prodPoids;
    }

    /**
     * Get prodPoids
     *
     * @return float 
     */
    public function getProdPoids()
    {
        return $this->prodPoids;
    }

    /**
     * Set prodStock
     *
     * @param integer $prodStock
     */
    public function setProdStock($prodStock)
    {
        $this->prodStock = $prodStock;
    }

    /**
     * Get prodStock
     *
     * @return integer 
     */
    public function getProdStock()
    {
        return $this->prodStock;
    }

    /**
     * Set prodLienImage
     *
     * @param text $prodLienImage
     */
    public function setProdLienImage($prodLienImage)
    {
        $this->prodLienImage = $prodLienImage;
    }

    /**
     * Get prodLienImage
     *
     * @return text 
     */
    public function getProdLienImage()
    {
        return $this->prodLienImage;
    }

    /**
     * Set prodLienProd
     *
     * @param text $prodLienProd
     */
    public function setProdLienProd($prodLienProd)
    {
        $this->prodLienProd = $prodLienProd;
    }

    /**
     * Get prodLienProd
     *
     * @return text 
     */
    public function getProdLienProd()
    {
        return $this->prodLienProd;
    }

    /**
     * Add comm
     *
     * @param KGK\StoreBundle\Entity\Commande $comm
     */
    public function addCommande(\KGK\StoreBundle\Entity\Commande $comm)
    {
        $this->comm[] = $comm;
    }

    /**
     * Get comm
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getComm()
    {
        return $this->comm;
    }

    /**
     * Set cat
     *
     * @param KGK\StoreBundle\Entity\Categorie $cat
     */
    public function setCat(\KGK\StoreBundle\Entity\Categorie $cat)
    {
        $this->cat = $cat;
    }

    /**
     * Get cat
     *
     * @return KGK\StoreBundle\Entity\Categorie 
     */
    public function getCat()
    {
        return $this->cat;
    }
}